Refactor main loop in raft node of five node example to improve readability#549
Open
hhwyt wants to merge 2 commits into
Open
Refactor main loop in raft node of five node example to improve readability#549hhwyt wants to merge 2 commits into
hhwyt wants to merge 2 commits into
Conversation
Signed-off-by: hhwyt <hhwyt1@gmail.com>
cd322d7 to
d133b6d
Compare
- Adjusted the indentation in documentation comments to ensure proper formatting. - Replaced legacy numeric constants with associated constants. - Removed unnecessary import of legacy numeric constants. Signed-off-by: hhwyt <hhwyt1@gmail.com>
Author
|
/cc @glorv @overvenus PTAL. |
overvenus
reviewed
Sep 5, 2024
|
|
||
| 1. Check whether `messages` is empty or not. If not, it means that the node will send messages to | ||
| other nodes: | ||
| other nodes: |
Author
There was a problem hiding this comment.
unnecessary space?
This is a compiler error from CI, so I made this change.
CI output:
error: doc list item missing indentation
--> src/lib.rs:204:1
|
204 | other nodes:
| ^
|
= help: if this is supposed to be its own paragraph, add a blank line
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
note: the lint level is defined here
--> src/lib.rs:478:9
|
478 | #![deny(clippy::all)]
| ^^^^^^^^^^^
= note: `#[deny(clippy::doc_lazy_continuation)]` implied by `#[deny(clippy::all)]`
help: indent this line
|
204 | other nodes:
| +++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
The
examples/five_mem_nodemain loop was hard to read and maintain because control flow and polling logic were densely nested. In addition, CI surfaced minor compilation/style issues in other files.What is changed?
examples/five_mem_node/main.rsfor clearer control flow and readability.src/lib.rs,src/quorum/majority.rs,src/raw_node.rs,src/storage.rs,src/util.rs).Impact
Test plan
cargo testcargo test --examples